package cn.edu.mju.cooprateflat.module.system.validator;

import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;
import com.jfinal.validate.Validator;

public class LoginValidator extends Validator {
    @Override
    protected void validate(Controller controller) {
        setRet(Ret.fail());
        validateRequiredString("loginName","msg", "请输入登录名称");
        validateRequiredString("loginPwd","msg", "请输入登录密码");
        validateRequiredString("code","msg", "请输入验证码");
    }

    @Override
    protected void handleError(Controller controller) {
        controller.renderJson(getRet());
    }
}
